package com.ouyeel.cw.util;

import com.ouyeel.cw.model.Config;
import javafx.scene.control.Alert;

/**
 * @author song xj
 * @version 1.0
 * @create 2020-06-30 7:24
 * @copyright
 **/
public class CommonUtils {

    public static void alert(String msg, Alert.AlertType type) {
        Alert alert = new Alert(type);
        alert.titleProperty().set("友情提示");
        alert.headerTextProperty().set(msg);
        alert.showAndWait();
    }

    public static void alertErr(String msg) {
        CommonUtils.alert(msg, Alert.AlertType.ERROR);
    }

    public static void alertInfo(String msg) {
        CommonUtils.alert(msg, Alert.AlertType.INFORMATION);
    }

    static Config config;

    public static Config getConfig() {
        return config;
    }

    public static void setConfig(Config config_) {
        config = config_;
    }
}
